package com.my.framework.autoconfigure.redis;

import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("qm.redis")
public class RedisProperties {
  private Single single;
  
  private Sentinel sentinel;
  
  private Cluster cluster;
  
  public void setSingle(Single single) {
    this.single = single;
  }
  
  public void setSentinel(Sentinel sentinel) {
    this.sentinel = sentinel;
  }
  
  public void setCluster(Cluster cluster) {
    this.cluster = cluster;
  }
  
  public void setIdleConnectionTimeout(int idleConnectionTimeout) {
    this.idleConnectionTimeout = idleConnectionTimeout;
  }
  
  public void setConnectTimeout(int connectTimeout) {
    this.connectTimeout = connectTimeout;
  }
  
  public void setTimeout(int timeout) {
    this.timeout = timeout;
  }
  
  public void setPassword(String password) {
    this.password = password;
  }
  
  public void setConnectionPoolSize(int connectionPoolSize) {
    this.connectionPoolSize = connectionPoolSize;
  }
  
  public void setConnectionMinimumIdleSize(int connectionMinimumIdleSize) {
    this.connectionMinimumIdleSize = connectionMinimumIdleSize;
  }
  
  public void setRetryAttempts(int retryAttempts) {
    this.retryAttempts = retryAttempts;
  }
  
  public void setRetryInterval(int retryInterval) {
    this.retryInterval = retryInterval;
  }
  
  public void setLockWatchdogTimeout(long lockWatchdogTimeout) {
    this.lockWatchdogTimeout = lockWatchdogTimeout;
  }
  
  public void setCodecClassName(String codecClassName) {
    this.codecClassName = codecClassName;
  }
  
  public boolean equals(Object o) {
    if (o == this)
      return true; 
    if (!(o instanceof RedisProperties))
      return false; 
    RedisProperties other = (RedisProperties)o;
    if (!other.canEqual(this))
      return false; 
    Object this$single = getSingle(), other$single = other.getSingle();
    if ((this$single == null) ? (other$single != null) : !this$single.equals(other$single))
      return false; 
    Object this$sentinel = getSentinel(), other$sentinel = other.getSentinel();
    if ((this$sentinel == null) ? (other$sentinel != null) : !this$sentinel.equals(other$sentinel))
      return false; 
    Object this$cluster = getCluster(), other$cluster = other.getCluster();
    if ((this$cluster == null) ? (other$cluster != null) : !this$cluster.equals(other$cluster))
      return false; 
    if (getIdleConnectionTimeout() != other.getIdleConnectionTimeout())
      return false; 
    if (getConnectTimeout() != other.getConnectTimeout())
      return false; 
    if (getTimeout() != other.getTimeout())
      return false; 
    Object this$password = getPassword(), other$password = other.getPassword();
    if ((this$password == null) ? (other$password != null) : !this$password.equals(other$password))
      return false; 
    if (getConnectionPoolSize() != other.getConnectionPoolSize())
      return false; 
    if (getConnectionMinimumIdleSize() != other.getConnectionMinimumIdleSize())
      return false; 
    if (getRetryAttempts() != other.getRetryAttempts())
      return false; 
    if (getRetryInterval() != other.getRetryInterval())
      return false; 
    if (getLockWatchdogTimeout() != other.getLockWatchdogTimeout())
      return false; 
    Object this$codecClassName = getCodecClassName(), other$codecClassName = other.getCodecClassName();
    return !((this$codecClassName == null) ? (other$codecClassName != null) : !this$codecClassName.equals(other$codecClassName));
  }
  
  protected boolean canEqual(Object other) {
    return other instanceof RedisProperties;
  }
  public int hashCode() {
    int PRIME = 59;
    int result = 1;
    Object $single = getSingle();
    result = result * 59 + (($single == null) ? 43 : $single.hashCode());
    Object $sentinel = getSentinel();
    result = result * 59 + (($sentinel == null) ? 43 : $sentinel.hashCode());
    Object $cluster = getCluster();
    result = result * 59 + (($cluster == null) ? 43 : $cluster.hashCode());
    result = result * 59 + getIdleConnectionTimeout();
    result = result * 59 + getConnectTimeout();
    result = result * 59 + getTimeout();
    Object $password = getPassword();
    result = result * 59 + (($password == null) ? 43 : $password.hashCode());
    result = result * 59 + getConnectionPoolSize();
    result = result * 59 + getConnectionMinimumIdleSize();
    result = result * 59 + getRetryAttempts();
    result = result * 59 + getRetryInterval();
    long $lockWatchdogTimeout = getLockWatchdogTimeout();
    result = result * 59 + (int)($lockWatchdogTimeout >>> 32L ^ $lockWatchdogTimeout);
    Object $codecClassName = getCodecClassName();
    return result * 59 + (($codecClassName == null) ? 43 : $codecClassName.hashCode());
  }
  
  public String toString() {
    return "RedisProperties(single=" + getSingle() + ", sentinel=" + getSentinel() + ", cluster=" + getCluster() + ", idleConnectionTimeout=" + getIdleConnectionTimeout() + ", connectTimeout=" + getConnectTimeout() + ", timeout=" + getTimeout() + ", password=" + getPassword() + ", connectionPoolSize=" + getConnectionPoolSize() + ", connectionMinimumIdleSize=" + getConnectionMinimumIdleSize() + ", retryAttempts=" + getRetryAttempts() + ", retryInterval=" + getRetryInterval() + ", lockWatchdogTimeout=" + getLockWatchdogTimeout() + ", codecClassName=" + getCodecClassName() + ")";
  }
  
  public Single getSingle() {
    return this.single;
  }
  
  public Sentinel getSentinel() {
    return this.sentinel;
  }
  
  public Cluster getCluster() {
    return this.cluster;
  }
  
  private int idleConnectionTimeout = 10000;
  
  public int getIdleConnectionTimeout() {
    return this.idleConnectionTimeout;
  }
  
  private int connectTimeout = 10000;
  
  public int getConnectTimeout() {
    return this.connectTimeout;
  }
  
  private int timeout = 30000;
  
  private String password;
  
  public int getTimeout() {
    return this.timeout;
  }
  
  public String getPassword() {
    return this.password;
  }
  
  private int connectionPoolSize = 64;
  
  public int getConnectionPoolSize() {
    return this.connectionPoolSize;
  }
  
  private int connectionMinimumIdleSize = 24;
  
  public int getConnectionMinimumIdleSize() {
    return this.connectionMinimumIdleSize;
  }
  
  private int retryAttempts = 3;
  
  public int getRetryAttempts() {
    return this.retryAttempts;
  }
  
  private int retryInterval = 1500;
  
  public int getRetryInterval() {
    return this.retryInterval;
  }
  
  private long lockWatchdogTimeout = 5000L;
  
  public long getLockWatchdogTimeout() {
    return this.lockWatchdogTimeout;
  }
  
  private String codecClassName = "org.redisson.client.codec.StringCodec";
  
  public String getCodecClassName() {
    return this.codecClassName;
  }
  
  public static class Single {
    public void setHost(String host) {
      this.host = host;
    }
    
    public void setPort(int port) {
      this.port = port;
    }
    
    public void setDatabase(int database) {
      this.database = database;
    }
    
    public boolean equals(Object o) {
      if (o == this)
        return true; 
      if (!(o instanceof Single))
        return false; 
      Single other = (Single)o;
      if (!other.canEqual(this))
        return false; 
      Object this$host = getHost(), other$host = other.getHost();
      return ((this$host == null) ? (other$host != null) : !this$host.equals(other$host)) ? false : ((getPort() != other.getPort()) ? false : (!(getDatabase() != other.getDatabase())));
    }
    
    protected boolean canEqual(Object other) {
      return other instanceof Single;
    }
    
    public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $host = getHost();
      result = result * 59 + (($host == null) ? 43 : $host.hashCode());
      result = result * 59 + getPort();
      return result * 59 + getDatabase();
    }
    
    public String toString() {
      return "RedisProperties.Single(host=" + getHost() + ", port=" + getPort() + ", database=" + getDatabase() + ")";
    }
    
    private String host = "localhost";
    
    public String getHost() {
      return this.host;
    }
    
    private int port = 6379;
    
    public int getPort() {
      return this.port;
    }
    
    private int database = 0;
    
    public int getDatabase() {
      return this.database;
    }
  }
  
  public static class Sentinel {
    private String master;
    
    private List<String> nodes;
    
    public void setMaster(String master) {
      this.master = master;
    }
    
    public void setNodes(List<String> nodes) {
      this.nodes = nodes;
    }
    
    public void setDatabase(int database) {
      this.database = database;
    }
    
    public boolean equals(Object o) {
      if (o == this)
        return true; 
      if (!(o instanceof Sentinel))
        return false; 
      Sentinel other = (Sentinel)o;
      if (!other.canEqual(this))
        return false; 
      Object this$master = getMaster(), other$master = other.getMaster();
      if ((this$master == null) ? (other$master != null) : !this$master.equals(other$master))
        return false; 
      Object this$nodes = (Object)getNodes(), other$nodes = (Object)other.getNodes();
      return ((this$nodes == null) ? (other$nodes != null) : !this$nodes.equals(other$nodes)) ? false : (!(getDatabase() != other.getDatabase()));
    }
    
    protected boolean canEqual(Object other) {
      return other instanceof Sentinel;
    }
    
    public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $master = getMaster();
      result = result * 59 + (($master == null) ? 43 : $master.hashCode());
      Object $nodes = getNodes();
      result = result * 59 + (($nodes == null) ? 43 : $nodes.hashCode());
      return result * 59 + getDatabase();
    }
    
    public String toString() {
      return "RedisProperties.Sentinel(master=" + getMaster() + ", nodes=" + getNodes() + ", database=" + getDatabase() + ")";
    }
    
    public String getMaster() {
      return this.master;
    }
    
    public List<String> getNodes() {
      return this.nodes;
    }
    
    private int database = 0;
    
    public int getDatabase() {
      return this.database;
    }
  }
  
  public static class Cluster {
    private List<String> nodes;
    
    private Integer maxRedirects;
    
    public void setNodes(List<String> nodes) {
      this.nodes = nodes;
    }
    
    public void setMaxRedirects(Integer maxRedirects) {
      this.maxRedirects = maxRedirects;
    }
    
    public boolean equals(Object o) {
      if (o == this)
        return true; 
      if (!(o instanceof Cluster))
        return false; 
      Cluster other = (Cluster)o;
      if (!other.canEqual(this))
        return false; 
      Object this$nodes = (Object)getNodes(), other$nodes = (Object)other.getNodes();
      if ((this$nodes == null) ? (other$nodes != null) : !this$nodes.equals(other$nodes))
        return false; 
      Object this$maxRedirects = getMaxRedirects(), other$maxRedirects = other.getMaxRedirects();
      return !((this$maxRedirects == null) ? (other$maxRedirects != null) : !this$maxRedirects.equals(other$maxRedirects));
    }
    
    protected boolean canEqual(Object other) {
      return other instanceof Cluster;
    }
    
    public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $nodes = (Object)getNodes();
      result = result * 59 + (($nodes == null) ? 43 : $nodes.hashCode());
      Object $maxRedirects = getMaxRedirects();
      return result * 59 + (($maxRedirects == null) ? 43 : $maxRedirects.hashCode());
    }
    
    public String toString() {
      return "RedisProperties.Cluster(nodes=" + getNodes() + ", maxRedirects=" + getMaxRedirects() + ")";
    }
    
    public List<String> getNodes() {
      return this.nodes;
    }
    
    public Integer getMaxRedirects() {
      return this.maxRedirects;
    }
  }
}
